﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Linq;
using QLKetNoi;

namespace QLPhanQuyen.DAO
{
    public class QuyenHanDAO
    {
        QLDNDataContext db = new QLDNDataContext();
        Table<QUYENHAN> quyenhans;

        public string LayMaTheoTen(string ten)
        {
            quyenhans = db.GetTable<QUYENHAN>();

            var query = (from qh in quyenhans
                        where qh.TenQuyenHan == ten
                         select qh.MaQuyenHan).FirstOrDefault();
            return query;
        }
    }
}
